package com.desay.pangoo.itmt.entity.rag;


import com.desay.pangoo.itmt.entity.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户会话实体
 * @author uids1175
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "rag_chat")
@Data
@DynamicInsert
@DynamicUpdate
@Where(clause = "deleted=0")
public class ChatEntity extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "chat_id", columnDefinition = "bigint COMMENT '主键'")
    @JsonSerialize()
    private Long chatId;

    @Column(name = "chat_title", columnDefinition = "varchar(255) default 'New Chat' COMMENT '当前会话的标题，默认为New Chat'")
    private String chatTitle;

    @Column(name = "user_id", columnDefinition = "varchar(255) COMMENT '关联的用户Id'")
    private String userId;

    @Column(name = "deleted", columnDefinition = "tinyint default 0 COMMENT '标识记录是否删除，0标识未删除，1标识删除'")
    private Integer deleted;


}
